package com.jic.bean;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;


//表格时间数字处理
public class DataFomater {

    public static Date getDate(int days) {

        Calendar c = Calendar.getInstance();

        c.set(1900, 0, 1);

        c.add(Calendar.DATE, days - 2);

        return c.getTime();

    }

    public static Date getTime(Date date) {

        Calendar c = Calendar.getInstance();

        c.setTime(date);

        return c.getTime();

    }

    public static void main(String[] args) throws Exception {
        DataFomater da=new DataFomater();

        Date date =new DataFomater().getDate(43717);
        Date dateTime = new DataFomater().getTime(date);


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        System.out.println(sdf.format(dateTime));


    }



}
